﻿@using RiderShop.Mobile.Common.Component
@section title
{
    鲜享卡/银信商通卡余额查询
}
@section pagetitle
{
    鲜享卡/银信商通卡余额查询
}

@section header
{
    <link rel="stylesheet" href="~/Themes/RongJi/Style/base/css/sign.css?v=1">
    <style>
   
        .body {
            margin-top: 10%;
        }

        .amount {
            margin-top: 20px;
            text-align: center;
            font-size: 16px;
        }

        .btn-green {
            background: #79c9a5;
        }
    </style>
}


<div class="top"><img src="~/Themes/RongJi/Style/base/imgs/card.jpg" alt=""></div>
<div class="amount">
    查询余额
</div>
<form action="~/Purchase/YinxinBalance" method="POST" id="yixinPayForm">
    <div class="body">
        <input type="text" class="form-control" id="cardNumber" name="cardNumber" maxlength="30" placeholder="请输入卡号">
        <input type="password" class="form-control" id="password" name="password" placeholder="请输入密码" maxlength="20" autocomplete="off">

        <span class="err_msg" id="msgError"></span>
    </div>
    <div class="bottom">
        <div class="btn-group btn-group-justified btn-wrapper" role="group" aria-label="...">
            <div class="btn-group" role="group">
                <input type="button" id="btnyixinQuery" class="btn" value="余额">
            </div>
        </div>
    </div>
</form>


@section footer
{
    <script type="text/javascript">
        $(function () {
            var cardNumber = $.cookie('xxCardNumber');
            if (cardNumber) {
                $("#cardNumber").val(cardNumber);
            }


        });
      

        $("#btnyixinQuery").click(function () {
            if ($("#cardNumber").val() == "") {
                KevinShop.MessageBox.Alert("请输入用户名!");
                return false;
            } if ($("#password").val() == "") {
                KevinShop.MessageBox.Alert("请输入密码!");
                return false;
            }

            $.cookie('xxCardNumber', $("#cardNumber").val());

            var postdata = $("#yixinPayForm").serialize();
            //document.forms["yixinPayForm"].submit();
            var loadMark = KevinShop.Common.Loading;
            $.ajax({
                type: "post",
                url: '/Purchase/YinxinBalance',
                data: postdata,
                contentType: "application/x-www-form-urlencoded; charset=utf-8",
                beforeSend: function (XMLHttpRequest) {
                    loadMark.show();
                    $("#msgError").html("正在查询，请稍等。");
                },
                success: function (data) {
                    $("#msgError").html(data);
                },
                complete: function (XMLHttpRequest, textStatus) {
                    //HideLoading();
                    loadMark.hide();
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    //请求出错处理
                    $("#msgError").html("服务器异常，请刷新页面重试！");
                    loadMark.hide();
                }
            });
        });
    </script>
}
